
var express = require('express');
var userRouter = express.Router();
const userController = require('../../controller/admin/userController')

//图片上传
const multer = require('multer')
const upload = multer({ dest: 'public/avataruploads/' })

/* GET users listing. */
userRouter.post('/adminapi/user/login', userController.login);

userRouter.post('/adminapi/user/upload', upload.single('file'), userController.upload);

userRouter.post('/adminapi/user/add', upload.single('file'), userController.add);

userRouter.get('/adminapi/user/list', userController.getList);

userRouter.get('/adminapi/user/list/:id', userController.getList);

userRouter.delete('/adminapi/user/list/:id', userController.delList);

userRouter.put('/adminapi/user/list/:id', userController.putList);





module.exports = userRouter;
